import File from '../basics/File.js'
import AnalogyChange from '../tools/AnalogyChange.js'
import Core from '../Core.js'
import In from './In.js'
import { ipcRenderer, remote } from 'electron';
import Factory from "../Factory";
/**
 * 入口
 */
export default  class Entry{


constructor(){


}
  /*  componentDidMount = () => {
    }
    componentWillUnmount = () => {
          ipcRenderer.removeListener('outMes' );
        ipcRenderer.removeListener('inMes' );
    }*/
        run(){
            let _this=this;
            //输入 接受
            ipcRenderer.on('inMes', (event, arg) => {
                _this.inMes(event,arg)
            });
        }
        inMes1(event,arg){
          let core=  Core.instance;
            switch(arg.outTyep){
                case 'A': //设置环境
                    console.log(arg.mes)
                    let srt3="配置依赖和启动文件，项目名称XXX，依赖都管核心包、网页基础包。"
                    let wordIds= Sentence.word(srt3)
                    let xx=  core.ideaRun(wordIds);

                    let file=  core.analysisRun(xx);

                   core.addTask(file)
                    break;
            }
        }
    inMes(event,arg){
        let core=  Core.instance();
        core.addTask(arg.mes   ,arg.outTyep )
           /* switch(arg.outTyep){
                case 'A': //设置环境
                    console.log(arg.mes)
                    core.addTask(arg.mes   ,taskType )
                    break;
                case 'B': //设置环境
                    console.log(arg.mes)
                    core.addTask(arg.mes   ,taskType )
                    break;
            }*/
         /*  let core=  Core.instance();
           let {pid,para,source   ,taskType}=arg;
            core.addTask(pid,para,source   ,taskType )*/
    }


}